import { SET_HEADER_TITLE, SET_TOKEN, SET_SCOPE, SET_USER, SET_USER_AVATAR} from "./mutation-type";

export default {
	setHeaderTitle({ commit }, headerTitles) {
	    commit(SET_HEADER_TITLE, {headerTitles});
	},
    setToken({ commit }, token) {
        commit(SET_TOKEN, {token});
    },
    setUser({ commit }, user) {
        commit(SET_USER, {user})
    },
	setUserAvatar({ commit }, avatar) {
	    commit(SET_USER_AVATAR, {avatar})
	},
	logout({ commit }) {
		commit(SET_HEADER_TITLE, []);
		commit(SET_TOKEN, '');
		commit(SET_USER, {});
		localStorage.removeItem('vuex');
		sessionStorage.clear();
	},
}
